<!DOCTYPE html>

<!-- $Id: index.html 79 2012-03-14 12:55:47Z azbitnev@gmail.com $ -->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1"/>

<link href="../../css/basics.css" rel="stylesheet" type="text/css"/>
<link href="../../css/960c12.css" rel="stylesheet" type="text/css"/>
<link href="../../css/style.css" rel="stylesheet" type="text/css"/>
<!--[if lt IE 10]><link href="../../css/ie.css" rel="stylesheet" type="text/css"/><![endif]-->

<script type="text/javascript" charset="utf-8" src="../../jquery/1.7.1.js"></script> 

<title>jquery.ajp.autocomplete - examples</title>

<link href="../../source/css/release/jquery.ajp.css" rel="stylesheet" type="text/css"/>
<link href="../../source/css/release/theme/jquery.ajp.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" charset="utf-8" src="../../source/release/jquery.ajp.js"></script> 

<style>

body { margin: 1em; }

#ex1 { width: 20em; }

</style>

<script>

$(document).ready(function () {

	$('#ex1').ajp$autocomplete({
		getUrl: function (needle) {
			if (/[a-z]+/.test(needle))
				return { url: './ex1-' + needle + '.js', params: { 'needle': needle } }
			return { url: './autocomplete/', params: { 'needle': needle } }
		},
	})
})

</script>

</head>

<body class="controls shaded-controls">
	<input type="text" class="field" id="ex1"/> Type "a"
</body>